<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link href="${cssFileServer}/login.css" rel="stylesheet" type="text/css">
<title>登录</title>
<script type="text/javascript" src="${jsFileServer}/jquery/base/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="${jsFileServer}/jquery/base/jquery.validate.min.js"></script>
</head>
<body class="login">

<div class="login_m">
	<div class="login_logo"></div>
	<div class="login_boder">
	<form id="loginForm" action="${mainServer}/login.jsop" method="post">
		<div class="login_padding">
			<h2>用户名</h2>
			<label>
				<input type="text" id="tsuName" name="tsuName" class="txt_input txt_input2" value="<shiro:principal/>" required data-msg-required="请输入用户名">
			</label>
			<h2>密码</h2>
			<label>
				<input type="password" id="tsuPassword" name="tsuPassword" class="txt_input"  required data-msg-required="请输入密码">
			</label>
			<h2>验证码</h2>
				<input name="kaptcha" type="text" id="kaptcha" class="check_input" /> <img src="./kaptcha/getKaptchaImage.htm" id="kaptchaImage" height="36px"/>  
			<br>
	        <div><a href="#" onclick="changeCode()" style="margin-left:165px;">看不清?换一张</a></div>  
			<div class="rem_sub">
				<div class="rem_sub_l">
				 <input type="checkbox"  id="rememberMe" name="remeberMe" value="true">
					<label for="checkbox">记住我</label> 
				</div>
				<label>
					<input type="reset" class="sub_reset" name="button" id="reset" value="重置" style="opacity: 0.7;">
				</label>
				<label>
					<input type="submit" class="sub_button" name="button" id="button" value="登录" style="opacity: 0.7;">
				</label>
			</div>
		</div>
		</form>
	</div>
</div>

<br />
<br />
<div><p align="center"><a href="http://www.sxnj.cn/" target="_blank" title="陕西省农业机械管理局">陕西省农业机械管理局</a></p></div>

<script type="text/javascript">
	
function changeCode() {  
    $('#kaptchaImage').hide().attr('src', './kaptcha/getKaptchaImage.htm?' + Math.floor(Math.random()*100) ).fadeIn();  
} 
	
	$(function(){
		
		/*$("#loginForm").validate( {
			rules: {
				tcuName: {
					required: true
				},
				tcuPassword: {
					required: true,
				}
			},
			messages: {
				tcuName: {
					required: "Please enter a username"
				},
				tcuPassword: {
					required: "Please provide a password"
				}
			}
		} );*/
		
		$('#kaptchaImage').click(function () {//生成验证码  
		     $(this).hide().attr('src', './kaptcha/getKaptchaImage.htm?' + Math.floor(Math.random()*100) ).fadeIn();  
		    });  
		
		
		$("#tcuName").focus(function(){
			$('#tcuName').val('');
		});
		$("#tcuPassword").focus(function(){
			$('#tcuPassword').val('');
		});
		$('#reset').click(function(){
			$('#tcuName').val('请输入用户名');
			$('#tcuPassword').val('******');
		});
	});
</script>
</body>
</html>